<?php
class Server_info_model extends CI_Model{

	function getAllServerInfo(){
		$data=$this->db->get('server_info');
		return $data;
	}

	function delServerInfo($id){
		$this->db->where('serverid',$id);
		$data=$this->db->delete('server_info');
		return $data;
	}

	function getServerInfo($id){
		$this->db->where('serverid',$id);
		$data=$this->db->get('server_info');
		return $data;
	}

	function  addServerInfo(){
		$data=array(
				'serverna'=>$_POST['serverna'],
				'servertime'=>$_POST['servertime'], 
		);
		$this->db->insert('server_info',$data);
		return $this->db->insert_id();
	}

	function  updateServerInfo($id,$data){
		$this->db->where('serverid',$id);
		$this->db->update('server_info',$data);
	}
}
?>